#pragma once

#include <Network/TcpConnection.h>

#include <set>

class ServerPacketHandler : public TcpConnectionEventHandler
{
protected:
	ServerPacketHandler(void);
	virtual ~ServerPacketHandler(void);
	
private:
	virtual void OnConnected(TcpConnection*, int error);
	virtual void OnReceived(TcpConnection*, TcpPacket* packet, int error);
	virtual void OnSent(TcpConnection*, int error);
	virtual void OnClosed(TcpConnection*, int error);

protected:
	virtual void OnLogin(uint64_t user_id) = 0;

private:
	std::set<TcpConnection*> connections_;
};

